var http=require('http');
var url=require('url');
http.createServer(function(request,response){
	var _url=url.parse(request.url).pathname;
	switch(_url){
	  case "/query":
	  response.writeHead('200',{'Content-Type':'application/json;charset=utf-8','Access-Control-Allow-Origin':'*'});
      var jsons='{"total":"10","result":[{"goodsId":"001","goodsName":"hamber","goodsImg":"https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1474985944&di=029fedeebcd6a2edbb30057214d39ef7&src=http://pic1.cxtuku.com/00/02/98/b71235fafb6d.jpg"},{"goodsId":"002","goodsName":"菜刀","goodsImg":"http://image.big5.made-in-china.com/37f28j01OBHtPYbMECcS/%E4%B8%8D%E9%94%88%E9%92%A2%E8%8F%9C%E5%88%80.jpg"},{"goodsId":"003","goodsName":"花环","goodsImg":"http://img3.redocn.com/tupian/20141108/jingmeideshengdanhuahuansucai_3391545.jpg"},{"goodsId":"003","goodsName":"花环","goodsImg":"http://f.hiphotos.baidu.com/baike/c0%3Dbaike92%2C5%2C5%2C92%2C30/sign=ecce1f126e81800a7ae8815cd05c589f/4bed2e738bd4b31cba97722685d6277f9f2ff880.jpg"}]}';
      response.write(jsons);
      response.end();
	  break;
	  case "/favicon.ico":
	  break;
	}
}).listen(3000);
console.log("db server is started");